import Vue from 'vue'
import Router from 'vue-router'
// 导入刚才编写的组件
import AppIndex from '@/components/Home/AppIndex.vue'
import Login from '@/components/Login.vue'
import Regist from '@/components/Regist.vue'
import Information from '@/components/Home/Information.vue'
import History from '@/components/Home/History.vue'
import homePage from '../components/homePage'
import TaskList from '../components/Home/TaskList'
import ReadTask from '../components/Home/ReadTask'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    // 下面都是固定的写法
    // {
    //   path: '/history',
    //   name: 'History',
    //   component: History
    // },
    // {
    //   path: '/Information',
    //   name: 'Information',
    //   component: Information
    // },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/index',
      name: 'AppIndex',
      component: AppIndex,
      children: [
        {
          path: '/history',
          name: 'History',
          component: History
        },
        {
          path: '/Information',
          name: 'Information',
          component: Information
        },
        {
          path: '/TaskList',
          name: 'TaskList',
          component: TaskList
        },
        {
          path: '/ReadTask',
          name: 'ReadTask',
          component: ReadTask
        }
      ]
    },
    {
      path: '/regist',
      name: 'Regist',
      component: Regist,
      meta: {
        index: 1,
        showFooter: false
      }
    },
    {
      path: '/',
      name: 'homePage',
      component: homePage
    }
  ]
})
